package com.vhall.component.service.goods.converter;

import com.vhall.component.entity.goods.GoodsEntity;
import com.vhall.component.entity.goods.goods.GoodsConsoleCreateReqVO;
import com.vhall.component.entity.goods.goods.GoodsConsoleUpdateReqVO;
import org.mapstruct.Mapper;

/**
 * @author yuanzh
 */
@Mapper(componentModel = "spring")
public interface GoodsConverter {

    /**
     * 创建商品请求对象转换为商品对象
     *
     * @param reqVO 请求对象
     * @return 商品对象
     */
    GoodsEntity to(GoodsConsoleCreateReqVO reqVO);

    /**
     * 修改商品请求对象转换为商品对象
     *
     * @param reqVO 请求对象
     * @return 商品对象
     */
    // @Mapping(target = "bgId", expression = "java( Integer.parseInt(reqVO.getBgId()) )")
    GoodsEntity to(GoodsConsoleUpdateReqVO reqVO);

}
